import time
import selenium.webdriver.support.ui import webDriverWait
from selenium import webdriver
from selenium.webdriver.common.by import By

browser = webdriver.Chrome()
browser.get('https://www.12306.cn/index/')
#
id_from_word = 'fromStationText'
id_to_word = 'toStationText'
locator = (By.ID, id_from_word, id_to_word)

wait = webDriverWait(browser, 10).until(EC.presense_of_element_located(locator))

input = browser.find_element(By.ID, id_from_word)
output = browser.find_element(By.ID, id_to_word)
input.clear()
input.send_keys("厦门北")
time.sleep(10)

output.clear()
output.send_keys("莆田")
time.sleep(10)



browser.quit()



